package com.nbjtjc.safe.mapper.emg;

import com.nbjtjc.safe.bean.Page;
import com.nbjtjc.safe.model.emg.EmgGoods;
import com.nbjtjc.util.MyMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmgGoodsMapper extends MyMapper<EmgGoods> {
    List<EmgGoods> search(@Param("goods")EmgGoods emgGoods, @Param("page") Page page);

    @Select("SELECT sum(emg_goods.count) as count,goods_name FROM emg_goods GROUP BY emg_goods.goods_name")
    List<EmgGoods> countByCategory();

}